| Total Complexity | 2 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import * as fs from 'fs' |
||
| 6 | |||
| 7 | class Mailhog extends Service { |
||
| 8 | service = 'mailhog' |
||
| 9 | |||
| 10 | |||
| 11 | nginxConfigPath = `${jaleNginxAppsPath}/mailhog.conf` |
||
| 12 | |||
| 13 | configure = async (): Promise<boolean> => { |
||
| 14 | await this.addNginxConfiguration() |
||
| 15 | await (new Nginx).restart() |
||
| 16 | |||
| 17 | return true |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Install the Mailhog Nginx configuration. |
||
| 22 | */ |
||
| 23 | addNginxConfiguration = async (): Promise<void> => { |
||
| 24 | const config = await getConfig() |
||
| 25 | return fs.writeFileSync(this.nginxConfigPath, nginxMailhogConf(config.tld)) |
||
| 26 | } |
||
| 31 |